#! /usr/bin/python
# coding: utf-8

from Tkinter import *

root = Tk()

def printProtocol():
    print 'WM_DELETE_WINDOW'
    root.destroy()

root.protocol('WM_DELETE_WINDOW', printProtocol)

root.mainloop()
